<?php
include_once 'ns_include.php';

class SoftwareUploaded extends subapplication
{
    private $cmd; 
    public static $PROTOCOL = "SoftwareUploaded";
    
    public static function create(commasnd $cmd)
    {
        if (!self::IsThisClass($cmd)) return null;
        
        $N = new upload($cmd);
        return $N;
    }
    
    private $stage = null;    
    private $description = null;
    private $id = null;
    
    
    public function __construct(command $cmd)
    {
        
        $this->cmd  = $cmd;
        $this->description = $cmd->GetData('DESCRIPTION');
        
        
    }
    
    public function execute()
    {
        
        
    }
    
    private function start()
    {
        // get a random string for the uploaded file to use.
       
        $this->cmd->SetResult('string');
    }

    private function describe_last_upload()
    {
        
    }

    public function result()
    {
        
    }




    /*
     * check to see if command is a UPLOAD
     */
    public static function IsThisClass(command $cmd)
    {
        
        if (!$cmd->HasDataKey('STAGE')) return false; // must conatin "STAGE"
        if (!$cmd->HasDataKey('DESCRIPTION')) return false; // must conatin "STAGE"


        return true;
    }
    
    public static $STAGE_START = "START";
    public static $STAGE_DESCRIBE = "DESCRIBE";

}

?>
